var user = require("./../model/user");

const obj = {
	/**首页*/
	userLogin : (req,res,next)=>{

		user.findAll({limit:50,offset:0,where:{id:{$gt:2}}}).then((data)=>{
			let arr = [];
			data.forEach((parm)=>{
				arr.push(parm.dataValues)
			})
			res.render("login",{"rows":arr});
		})
	},
	userLogined : (req,res,next) => {
		var username = req.query.username;
		var password = req.query.password;
		req.session.username = username;
		 res.redirect('/');
	}
}


module.exports = obj;

